package edu.bmstu.rslab;

import java.awt.geom.Point2D;
import java.util.List;

/**
 * Created by Chikh (using IntelliJ IDEA).
 * Date: 11.03.2009
 * Time: 20:06:06
 */
public class BasisOfLCS {

    public BasisOfLCS(Point2D pO, Point2D pX, Point2D pBase, Point2D pY) {
        this.pO = (Point2D) pO.clone();
        this.pX = (Point2D) pX.clone();
        this.pBase = (Point2D) pBase.clone();
        this.pY = (Point2D) pY.clone();
    }

    public static BasisOfLCS createBasisOfLCSFromList(List<Point2D> basis) {
        if (basis.size() == 4) {
            return new BasisOfLCS(basis.get(0), basis.get(1), basis.get(2), basis.get(3));
        }
        else {
            throw new RuntimeException("Incorrect list size. Expected: 4, Actual: " + basis.size());
        }
    }

    public Point2D getPO() {
        return (Point2D) pO.clone();
    }

    public Point2D getPX() {
        return (Point2D) pX.clone();
    }

    public Point2D getPBase() {
        return (Point2D) pBase.clone();
    }

    public Point2D getPY() {
        return (Point2D) pY.clone();
    }

    private final Point2D pO;
    private final Point2D pX;
    private final Point2D pBase;
    private final Point2D pY;
}
